import React from "react";

import {
  Form,
  Input,
  Button,
  Dialog,
  TextArea,
  DatePicker,
  Selector,
  Slider,
  Stepper,
  Switch,
} from "antd-mobile";
import {useNavigate} from 'react-router-dom'
function Home() {
    const navigate = useNavigate()
    const onFinish = (values) => {
    console.log(values)
    navigate('/list',{state:values})
  }
  return (
    <div>
      <Form
      onFinish={onFinish
      }
        layout="horizontal"
        footer={
          <Button block type="submit" color="primary" size="large">
            提交
          </Button>
        }
      >
        {/* <Form.Header>水平布局表单</Form.Header> */}
        <Form.Item
          name="start"
          label="起点"
          rules={[{ required: true, message: "不能为空" }]}
        >
          <Input  placeholder="请输入" />

        </Form.Item>
        <Form.Item
          name="end"
          label="终点"
          rules={[{ required: true, message: "姓名不能为空" }]}
        >
          <Input  placeholder="请输入姓名" />

        </Form.Item>
      </Form>
    </div>
  );
}

export default Home;
